﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DiscoveryLogic.Common.Numeric
{
    /// <summary>Abstract base class for resizable collections holding objects or primitive data types such as <code>int</code>, <code>float</code>, etc.
    /// First see the <a href="package-summary.html">package summary</a> and javadoc <a href="package-tree.html">tree view</a> to get the broad picture.
    /// <p>
    /// <b>Note that this implementation is not synchronized.</b>
    /// </summary>
    /// <author>  wolfgang.hoschek@cern.ch
    /// </author>
    /// <version>  1.0, 09/24/99
    /// </version>
    /// <seealso cref="java.util.ArrayList">
    /// </seealso>
    /// <seealso cref="java.util.Vector">
    /// </seealso>
    /// <seealso cref="java.util.Arrays">
    /// </seealso>
    //public abstract class AbstractCollection extends Object implements Cloneable, java.io.Serializable {
    [Serializable]
    public abstract class AbstractCollection : PersistentObject
    {
        /// <summary> Tests if the receiver has no elements.
        /// 
        /// </summary>
        /// <returns>  <code>true</code> if the receiver has no elements;
        /// <code>false</code> otherwise.
        /// </returns>
        virtual public bool Empty
        {
            get
            {
                return size() == 0;
            }

        }
        /// <summary> Makes this class non instantiable, but still let's others inherit from it.</summary>
        protected internal AbstractCollection()
        {
        }
        /// <summary> Removes all elements from the receiver.  The receiver will
        /// be empty after this call returns.
        /// </summary>
        public abstract void clear();
        /// <summary> Returns the number of elements contained in the receiver.
        /// 
        /// </summary>
        /// <returns>s  the number of elements contained in the receiver.
        /// </returns>
        public abstract int size();
        /// <summary> Returns a <code>java.util.ArrayList</code> containing all the elements in the receiver.</summary>
        public abstract System.Collections.ArrayList toList();
        /// <summary> Returns a string representation of the receiver, containing
        /// the String representation of each element.
        /// </summary>
        public override System.String ToString()
        {
            return SupportClass.CollectionToString(toList());
        }
    }
}
